package handler

import (
	"demo/internal/logic"
	"demo/internal/svc"
	"demo/internal/types"
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"
)


func ServeyInfoHandler(svcCtx *svc.ServiceContext)http.HandlerFunc{
	return func(w http.ResponseWriter, r *http.Request) {

		var req types.ServeyInfoRequest
		if err := httpx.Parse(r, &req); err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
			return
		}
		
		l := logic.NewServeyInfoLogic(r.Context(),svcCtx)

		resp,err := l.Info(&req)

		if err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
		} else {
			httpx.OkJsonCtx(r.Context(), w, resp)
		}
	}
}